package com.company.class3;

/**
 * @Classname WhileTest
 * @Description 类型说明
 * @Date 2022/4/17 17:27
 * @Created by zbw
 */

public class WhileTest {
    public static void main(String[] args) {

        int i = 88;
        while (i <= 100){
            System.out.println(i);
            i++;
        }
        //while 就相当于 for（;条件;）{}
        //while(true)死循环，相当于for(;;)
        while (true){
            System.out.println(i);
            if(i > 100){
                break;
            }
        }



        //while循环先判断，再执行循环体中的语句，而do while先执行后判断
        int x = 101;
        do{
            System.out.println(x);
            x++;
        }while (x <= 100);
    }
}
